<style type="text/css">
.layui-table-cell {
	height: auto;
	line-height: 28px;
}
</style>
<div class="layui-card">
	<div class="layui-card-body">
		<table class="layui-hide" id="demo"></table>
	</div>
</div>
<script>

    layui.use(['form', 'table', 'util', 'admin'], function () {
        var form = layui.form;
        var table = layui.table;
        var layer = layui.layer;
        var util = layui.util;
        var admin = layui.admin;

        var orders = '${orders}';
        

        //渲染表格
         table.render({
            elem: '#demo',
            data: JSON.parse(orders),
            page: false,
            cols: [[
                {type: 'numbers', title: '序号'},
                {field: 'productName', sort: false, title: '名称'},
                {field: 'quantity', sort: false, title: '数量(件)'},
                {field: 'productPrice', sort: false, title: '单价(元)'},
                {field: 'totalPrice', sort: false, title: '总价(元)'}
            ]]
        }); 
    })
